import ajax from '@/utils/http/request';
import { Key } from 'react';
import { IResHospitalSet, IAddHospitalSetData, IHospitalSetData } from './model/hospitalSetType';

// 获取医院设置的列表
export const reqHospitalSet = (page: number, limit: number, hosname?: string, hoscode?: string) =>
  ajax.get<any, IResHospitalSet>(`/admin/hosp/hospitalSet/${page}/${limit}`, {
    params: {
      hosname,
      hoscode,
    },
  });

// 添加医院设置
export const reqAddHospitalSet = (data: IAddHospitalSetData) => ajax.post<any, null>(`/admin/hosp/hospitalSet/save`, data);

// 编辑医院设置
export const reqUpdateHospitalSet = (data: IAddHospitalSetData) => ajax.put<any, null>(`/admin/hosp/hospitalSet/update`, data);

// 获取医院设置
export const reqGetIdHospitalSet = (id: number) => ajax.get<any, IHospitalSetData>(`/admin/hosp/hospitalSet/get/${id}`);

// 删除医院设置
export const reqDeleteHospitalSet = (id: number) => ajax.delete<any, null>(`/admin/hosp/hospitalSet/remove/${id}`);

// 批量删除医院设置
export const reqDeleteIdsHospitalSet = (ids: Key[]) =>
  ajax.delete<any, null>(`/admin/hosp/hospitalSet/batchRemove`, {
    data: ids,
  });
